home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / comm2 / termsorc.lha / Extras / Source / gtlayout-source.lha / LTP_Atol.c < prev    next >
C/C++ Source or Header  |  1995-09-24  |  401b  |  27 lines

  1. /*  GadTools layout toolkit
  2. **
  3. **  Copyright © 1993-1995 by Olaf `Olsen' Barthel
  4. **  Freely distributable.
  5. */
  6.  
  7. #include "gtlayout_global.h"
  8.  
  9. ULONG __regargs
  10. LTP_Atol(STRPTR String)
  11. {
  12.     ULONG Value = 0;
  13.  
  14.     while(*String == ' ' || *String == '\t')
  15.         String++;
  16.  
  17.     while(*String)
  18.     {
  19.         if(*String >= '0' && *String <= '9')
  20.             Value = (Value * 10) + ((*String++) & 0xF);
  21.         else
  22.             break;
  23.     }
  24.  
  25.     return(Value);
  26. }
  27.